<?php

/**
 * Description of checkTimeBlockAction
\* www.teuker.nl - mail@teuker.nl
 * 
 * @author francisc
 */

class checkTimeBlockAction extends sfAction {
    
    public function execute($request) {
        $is_block_time = Util::is_block_time(Util::convertDateClientServer($request->getParameter('date')), 
                                 $request->getParameter('time_hour'), 
                                 $request->getParameter('time_minute'),
                                 $this->getUser());
        
        if ($is_block_time['is_block_time']) {
            $this->reason = $is_block_time['reason'];
            return sfView::ERROR;
        }
        
        return sfView::SUCCESS;
    }
}
